class JurisdictionMembersController < ApplicationController
  def index
    @jurisdictionMembers = JurisdictionMember.all
    @jurisdictionMember = JurisdictionMember.new
  end

  def create
    @jurisdictionMember = JurisdictionMember.new

    @jurisdictionMember.user = User.find(params[:jurisdiction_member][:user])
    @jurisdictionMember.jurisdiction = Jurisdiction.find(params[:jurisdiction_member][:jurisdiction])
    @jurisdictionMember.role = Role.find(params[:jurisdiction_member][:role])
    
    @jurisdictionMember.save
    redirect_to jurisdiction_members_url
  end

  def destroy
    @jurisdictionMember = JurisdictionMember.find(params[:id])
    @jurisdictionMember.destroy
    redirect_to jurisdiction_members_url
  end

end
